package com.sharp.kernel.mybatis.repository;

import com.sharp.kernel.mybatis.join.entity.IJoinRelationship;
import com.sharp.kernel.mybatis.mapper.JoinMapper;
import com.sharp.kernel.mybatis.repository.inf.SqlJoinRepository;
import tk.mybatis.mapper.entity.Example;

import java.util.List;

/**
 * Title: BaseJoinRepository
 * Description: Copyright: Copyright (c) 2019 Company: BHFAE
 *
 * @author Sharp
 * @date 2022/7/27 9:18
 */
public class BaseJoinRepository<T extends IJoinRelationship, K extends JoinMapper<T>> extends BaseMybatisRepository<T, K> implements SqlJoinRepository<T> {
    @Override
    public int count(Example example) {
        return getDao().joinSelectCountByExample(example);
    }

    @Override
    public List<T> select(Example example) {
        return getDao().joinSelectByExample(example);
    }
}
